#include <stdio.h>
#include <math.h>
#define EPS 1e-4
int main()
{ double x,n;
do{printf("enter a positive number\n");
scanf("%lf",&n);
if(n<=n)
printf("error : %lf is not positive \n",n);
}while(n<=0);
x = n/2.0;
do{
    x = 0.5 * (x + n / x);
}while(fabs(pow(x,2) - n) >= EPS);
printf("the square of %lf by my sqrt function is %.10lf\n",n,x);
printf("the square of %lf by standrard sqrt function is %.10lf\n",n,pow(n,0.5));

    return 0;
}

